/**
 * 后台登录js
 */
//切换后台背景图片
var handleLoginPageChangeBackground = function() {
    $('[data-click="change-bg"]').live("click",
        function() {
            var e = '[data-id="login-cover-image"]';
            var t = $(this).find("img").attr("src");
            var n = '<img src="' + t + '" data-id="login-cover-image" />';
            $(".login-cover-image").prepend(n);
            $(e).not('[src="' + t + '"]').fadeOut("slow",
                function() {
                    $(this).remove()
                });
            $('[data-click="change-bg"]').closest("li").removeClass("active");
            $(this).closest("li").addClass("active")
        })
};
//enter快捷登录
var enterLogin = function() {
    $('body').bind('keypress',function(event){

        if(event.keyCode == "13") {

            $('.js_loginForm').trigger('submit');

        }

    });
}
var Login = function() {
    "use strict";
    return {
        init: function() {
            handleLoginPageChangeBackground();
            enterLogin();
        }
    }
}()